-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Add test:type to skip by connection type #14446
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for filtering tests based on device connection type (e.g., USB, Ethernet). Tests can now use test:type <type> to require a specific connection type or test:type !<type> to exclude one.
- Adds
test:typedirective parsing in test configuration - Implements connection type filtering in test execution logic
- Exposes
connection_typeproperty on Device objects
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| unit-tests/run-unit-tests.py | Adds logic to skip tests based on device connection type matching against required/excluded types |
| unit-tests/py/rspy/libci.py | Adds types property to test configuration for storing connection type filters |
| unit-tests/py/rspy/devices.py | Exposes connection_type property on Device class |
| unit-tests/live/metadata/test-usb-type-found.py | Updates test to use new test:type USB directive instead of device exclusions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for configuration, serial_numbers in devices_by_test_config( test, exceptions ): | ||
| # Currently, with all of our tests, serial_numbers holds a single serial number | ||
| # We will see multiple devices on serial_numbers only if the test specifies multiple devices in a | ||
| # single line. For example: "test:device D435 D455" will require both devices simultaneity |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'simultaneity' to 'simultaneously'.
| # single line. For example: "test:device D435 D455" will require both devices simultaneity | |
| # single line. For example: "test:device D435 D455" will require both devices simultaneously |
| elif directive == 'tag': | ||
| self._tags.update( map( str.lower, params )) # tags are case-insensitive | ||
| elif directive == 'type': | ||
| self._types.update( map( str.lower, params )) |
Copilot
AI
Nov 13, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The type directive lacks consistency with the tag directive comment on line 246. Consider adding a similar inline comment explaining that types are case-insensitive, matching the pattern established for tags.
| self._types.update( map( str.lower, params )) | |
| self._types.update( map( str.lower, params )) # types are case-insensitive |
Tracked on: [LRS-1342]